package structures.xmltable;

import java.io.Serializable;

import callers.esi.CTIDGenerator;

public class ServiceParameterTableHeader implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 270760184739697636L;
	private static final String DEFAULT_FCID = "001";
	private static final String DEFAULT_TCID = "000";
	private static final String DEFAULT_UID = "A07111";
	
	private String fcid;
	private String tcid;
	private String uid;
	private String ctid;

	public ServiceParameterTableHeader(String fcid, String tcid, String uid, String ctid) {
		super();
		init(fcid, tcid, uid, ctid);
	}
	public ServiceParameterTableHeader(String fcid, String tcid, String uid) {
		super();
		init(fcid, tcid, uid, CTIDGenerator.generateCTID());
	}
	public ServiceParameterTableHeader() {
		super();
		init(DEFAULT_FCID, DEFAULT_TCID, DEFAULT_UID, CTIDGenerator.generateCTID());
	}
	public void init(String fcid, String tcid, String uid, String ctid){
		this.fcid = fcid;
		this.tcid = tcid;
		this.uid = uid;
		this.ctid = ctid;
	}
	public String getFcid() {
		return fcid;
	}
	public void setFcid(String fcid) {
		this.fcid = fcid;
	}
	public String getTcid() {
		return tcid;
	}
	public void setTcid(String tcid) {
		this.tcid = tcid;
	}
	public String getUid() {
		return uid;
	}
	public void setUid(String uid) {
		this.uid = uid;
	}
	public String getCtid() {
		return ctid;
	}
	public void setCtid(String ctid) {
		this.ctid = ctid;
	}
	
	public ServiceParameterTableHeader clone(){
		return new ServiceParameterTableHeader(fcid, tcid, uid, ctid);
	}

	public void cloneTo(ServiceParameterTableHeader header){
		if(header == null)
			header = new ServiceParameterTableHeader(fcid, tcid, uid, ctid);
		else {
			header.init(fcid, tcid, uid, ctid);
		}
	}
	public ServiceParameterTableHeader reload(){
		this.ctid = CTIDGenerator.generateCTID();
		return this;
	}
}
